<template>
    <view class="wallet">
        <view class="mywallet">
            <view class="title">我的余额</view>
            <view class="flex-bet mywallet_info">
                <view class="flex-center">
                    <image class="wallet_img" src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/yeqb.png"></image>
                    <view class="wallet_money">¥{{ wallet }}</view>
                </view>
            </view>
        </view>
        <view @tap="tradeinfo" class="list flex-bet">
            <view class="flex-center trade">
                <image class="listimg" src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/gssj.png"></image>
                <view class="">交易明细</view>
            </view>
            <image class="addright" src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/blackjt.png"></image>
        </view>
        <view @tap="cash" class="list flex-bet" v-if="system.is_cz == 1">
            <view class="flex-center trade">
                <image class="listimg" src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/personal/chongzhi.png"></image>
                <view class="">去充值</view>
            </view>
            <image class="addright" src="https://yunkeososyunchuc.bc8t.cn/ymq_canyino2o/static/blackjt.png"></image>
        </view>
    </view>
</template>

<script>
import cardlist from '@/ymq_canyino2o/dist/cardlist/index';
import gettel from '@/ymq_canyino2o/dist/gettel/index';
var app = getApp();
export default {
    components: {
        cardlist,
        gettel
    },
    data() {
        return {
            system: {
                is_cz: 0
            },

            wallet: ''
        };
    },
    onLoad: function (t) {
        this.onLoadClone3389(t);
    },
    onReady: function () {},
    onShow: function () {
        this.onLoadClone3389({});
    },
    onHide: function () {},
    onUnload: function () {},
    onPullDownRefresh: function () {},
    onReachBottom: function () {},
    onShareAppMessage: function () {},
    methods: {
        onLoadClone3389: function (t) {
            uni.hideShareMenu({});
            this.setData({
                system: getApp().globalData.xtxx
            });
            app.globalData.setNavigationBarColor(this);
            var that = this;
            var a = uni.getStorageSync('users').id;
            app.globalData.util.request({
                url: 'entry/wxapp/UserInfo',
                cachetime: '0',

                data: {
                    user_id: a
                },

                success: function (t) {
                    console.log(t);
                    that.setData({
                        wallet: t.data.wallet
                    });
                }
            });
        },

        cash: function (t) {
            uni.navigateTo({
                url: 'walletadd'
            });
        },

        tradeinfo: function (t) {
            uni.navigateTo({
                url: 'walletmx'
            });
        }
    }
};
</script>
<style>
@import './wallet.css';
</style>
